# @Time : 2025-04-02 10:23
# @Author : Fioman 
# @Phone : 13149920693
"""

"""

import cv2 as cv

image = cv.imread("3.jpg", cv.IMREAD_COLOR)

xStart = 945
xEnd = 3130
newImage = image[:2609, xStart:xEnd]
h, w = newImage.shape[:2]
# 按照9:16的比例进行缩放
print(h, w)
newH = int(w * (4 / 3))
print(newH, (newH - h) / 5)

paddingImage = newImage[h - 5:h, :]

# 将paddingImage 进行自己拼接,相当于高度为paddingImage的33倍,33个paddingImage进行垂直拼接
newPaddingImage = paddingImage
for i in range(61):
    newPaddingImage = cv.vconcat([newPaddingImage, paddingImage])

# 将newImage和paddingImage进行拼接,形成一个新的图,paddingImage
newImage = cv.vconcat([newImage, newPaddingImage])
finalH, finalW = newImage.shape[:2]
print(finalH, finalW)

print(finalH / finalW / (16 / 9))

cv.imwrite("new.jpg", newImage)
